package com.imooc.bilibili.service;

import com.imooc.bilibili.dao.AuthRoleDao;
import com.imooc.bilibili.domain.auth.AuthRole;
import com.imooc.bilibili.domain.auth.AuthRoleElementOperation;
import com.imooc.bilibili.domain.auth.AuthRoleMenu;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

/**
 * ProjectName imooc-bilibili
 *
 * @author xieyucan
 * <br>CreateDate 2022/10/24 18:43
 */
@Service
public class AuthRoleService {

    @Resource
    private AuthRoleDao authRoleDao;

    @Resource
    private AuthRoleElementOperationService authRoleElementOperationService;

    @Resource
    private AuthRoleMenuService authRoleMenuService;

    public List<AuthRoleElementOperation> getRoleElementOperationList(Set<Long> roleSet) {
       return authRoleElementOperationService.getRoleElementOperationList(roleSet);
    }

    public List<AuthRoleMenu> getAuthRoleMenuByRoleId(Set<Long> roleSet) {

        return authRoleMenuService.getAuthRoleMenuByRoleId(roleSet);
    }

    public AuthRole getRoleByCode(String code) {
        return authRoleDao.getRoleByCode(code);
    }
}
